<?php
	if( ! defined('DS') )
	{
		define( 'DS', '/' );
	}

	$_config = array();

	$_config[ 'env' ][ 'debug' ] = true;

	//get path info
	$data['base'] = dirname( __FILE__ ) . '/';
	$data['path'] = pathinfo( $data['base'] );
	$data['directory'] = dirname( $_SERVER['SCRIPT_NAME'] ) . '/';

	//domain config
	$host_name = $_SERVER['HTTP_HOST'];
	$host_arg = explode( '.', $host_name );
	//$host_header = $host_arg[0];
	$_config[ 'domain' ][ 'main' ] = '.' . $host_arg[count($host_arg)-2] . '.' . $host_arg[count($host_arg)-1];

	$_config[ 'domain' ][ 'www' ] = $host_name;
	$_config[ 'domain' ][ 'tpl' ] = $_config[ 'domain' ][ 'www' ] . '/tpl';
	$_config[ 'domain' ][ 'upload' ] = $_config[ 'domain' ][ 'www' ] . '/tpl/u1';

	$_config[ 'url' ][ 'www' ] = 'http://' . $_config[ 'domain' ][ 'www' ] . '/';
	$_config[ 'url' ][ 'tpl' ] = 'http://' . $_config[ 'domain' ][ 'tpl' ] . '/';
	$_config[ 'url' ][ 'js' ] = $_config[ 'url' ][ 'tpl' ] . 'js/';
	$_config[ 'url' ][ 'css' ] = $_config[ 'url' ][ 'tpl' ] . 'css/';
	$_config[ 'url' ][ 'images' ] = $_config[ 'url' ][ 'tpl' ] . 'images/';

	//DOCUMENT_ROOT in http.conf should not add last slash.
	$_SERVER['DOCUMENT_ROOT'] = preg_replace( '/\/$/', '', $_SERVER['DOCUMENT_ROOT'] );

	$_config[ 'dir' ][ 'domainroot' ] = $_SERVER['DOCUMENT_ROOT'] . DS;
	$_config[ 'dir' ][ 'root' ] = dirname( $_config[ 'dir' ][ 'domainroot' ] ) . DS;
	$_config[ 'dir' ][ 'www' ] = $_config[ 'dir' ][ 'domainroot' ];
	$_config[ 'dir' ][ 'tpl' ] = $_config[ 'dir' ][ 'domainroot' ] . 'tpl' . DS;

	$_config[ 'dir' ][ 'inc' ] =$_config[ 'dir' ][ 'root' ] . 'inc' . DS;
	$_config[ 'dir' ][ 'lib' ] = $_config[ 'dir' ][ 'root' ] . 'lib' . DS;
	$_config[ 'dir' ][ 'biz' ] = $_config[ 'dir' ][ 'root' ] . 'biz' . DS;
	$_config[ 'dir' ][ 'log' ] = $_config[ 'dir' ][ 'root' ] . 'log' . DS;
	$_config[ 'dir' ][ 'lang' ] = $_config[ 'dir' ][ 'root' ] . 'lang' . DS;
	$_config[ 'dir' ][ 'upload' ] = $_config[ 'dir' ][ 'tpl' ] . 'u1' . DS;

	$_config[ 'file' ][ 'errorlog' ] = $_config[ 'dir' ][ 'log' ] . 'phperror.log';

	$_config[ 'db' ][ 'ip' ] = 'localhost';
	$_config[ 'db' ][ 'port' ] = 3306;
	$_config[ 'db' ][ 'database' ] = 'meye';
	$_config[ 'db' ][ 'user' ] = 'meye';
	$_config[ 'db' ][ 'password' ] = 'meye';
	$_config[ 'db' ][ 'charset' ] = 'utf8';

	//$_config[ 'lang' ]['en'] = 'en.php';
	//$_config[ 'lang' ]['zh'] = 'zh_cn.php';
?>